<html>
<head><meta charset="utf-8"><title>How to build rustc for Android targets? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20build.20rustc.20for.20Android.20targets.3F.html">How to build rustc for Android targets?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="225583714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20build%20rustc%20for%20Android%20targets%3F/near/225583714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Arlie Davis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20build.20rustc.20for.20Android.20targets.3F.html#225583714">(Feb 08 2021 at 18:04)</a>:</h4>
<p>I'm trying to build Rust for Android targets. I have the NDK installed, and I've set <code>build.android-ndk</code> in <code>config.toml</code> to the path of the NDK, but builds still fail with this:</p>
<div class="codehilite"><pre><span></span><code>ardavis@legion:~/rust$ ./x.py build
Updating only changed submodules
Submodules updated in 0.02 seconds
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
thread &#39;main&#39; panicked at &#39;

couldn&#39;t find required command: &quot;aarch64-linux-android-clang&quot;

&#39;, src/bootstrap/sanity.rs:60:13
</code></pre></div>



<a name="225584403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/How%20to%20build%20rustc%20for%20Android%20targets%3F/near/225584403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Arlie Davis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/How.20to.20build.20rustc.20for.20Android.20targets.3F.html#225584403">(Feb 08 2021 at 18:09)</a>:</h4>
<p>I noticed that the <code>android-ndk</code> was in the <code>[target.x86_64-unknown-linux-gnu]</code> section, so I created a <code>[target.aarch64-linux-android]</code> secton, and moved it there. That changed the nature of the failure to this:</p>
<div class="codehilite"><pre><span></span><code>couldn&#39;t find required command: &quot;/home/ardavis/dw/android-ndk-r21b/bin/aarch64-linux-android-clang&quot;
</code></pre></div>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>